<template>
  <!-- 专项练习 -->
  <div>
    <el-table
      :data="list"
      :border="false"
      :header-cell-style="{ background: '#FAFAFA' }"
      style="width: 100%"
    >
      <el-table-column prop="title" label="练习科目名称"> </el-table-column>
      <el-table-column label="答题类型">
        <template slot-scope="{ row }">
          {{ row.form == "全部题目" ? "循环模式" : "普通模式" }}
        </template>
      </el-table-column>
      <el-table-column label="正确率">
        <template slot-scope="{ row }">
          {{
            parseInt(((row.total - row.wrong - row.undo) / row.total) * 100)
          }}%
        </template>
      </el-table-column>
      <el-table-column label="答题时长">
        <template slot-scope="{ row }">
          {{
            row.use_time > 60
              ? (row.use_time>3600?parseInt(row.use_time / 60/60)+'时'+ parseInt(parseInt(row.use_time / 60)%60)  +
                "分" +
                parseInt(row.use_time % 60) +
                "秒": parseInt(row.use_time / 60) +
                "分" +
                parseInt(row.use_time % 60) +
                "秒")
              : row.use_time + "秒"
          }}
        </template>
      </el-table-column>
      <el-table-column prop="create_time" label="答题时间"> </el-table-column>
    </el-table>
    <!--  -->
  </div>
</template>

<script>
import { getapplyid, getsubjectTitle } from "@/utils/auth.js";
import { exermylist } from "@/api/admin.js";
import { mapGetters } from "vuex";
export default {
  props: ["titleName"],
  computed: {
    ...mapGetters(["userinfor", "nickname", "adminUserId"]),
  },
  data() {
    return {
      list: [],
      subject: getsubjectTitle(),
    };
  },
  methods: {
    dataList() {
      exermylist({ applyid: getapplyid() }).then((res) => {
        if (res.code == 200) {
          this.list = res.data.list;
        }
      });
    },
  },
  created() {
    this.dataList();
  },
};
</script>

<style lang="scss" scoped>
</style>